package ad.android.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import ad.android.util.Constants;

/**
 * TblCompany entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tbl_company", catalog = Constants.CATALOG)
public class Company implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 3811108059230048511L;
	private Long id;
	/**
	 * 广告主
	 */
	private AdHost tblAdhost;
	/**
	 * 公司名称
	 */
	private String companyName;
	/**
	 * 公司地址
	 */
	private String companyAddress;
	/**
	 * 公司电话
	 */
	private String companyPhone;

	// Constructors

	/** default constructor */
	public Company() {
	}

	/** minimal constructor */
	public Company(AdHost tblAdhost) {
		this.tblAdhost = tblAdhost;
	}

	/** full constructor */
	public Company(AdHost tblAdhost, String companyName,
			String companyAddress, String companyPhone) {
		this.tblAdhost = tblAdhost;
		this.companyName = companyName;
		this.companyAddress = companyAddress;
		this.companyPhone = companyPhone;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "ID", unique = true, nullable = true)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ADHOST_ID", nullable = false)
	public AdHost getTblAdhost() {
		return this.tblAdhost;
	}

	public void setTblAdhost(AdHost tblAdhost) {
		this.tblAdhost = tblAdhost;
	}

	@Column(name = "COMPANY_NAME", length = 200)
	public String getCompanyName() {
		return this.companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@Column(name = "COMPANY_ADDRESS", length = 200)
	public String getCompanyAddress() {
		return this.companyAddress;
	}

	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}

	@Column(name = "COMPANY_PHONE", length = 200)
	public String getCompanyPhone() {
		return this.companyPhone;
	}

	public void setCompanyPhone(String companyPhone) {
		this.companyPhone = companyPhone;
	}

}